<style>
    .index_nav .wrap li{
        width: 100%;
        height: 95px;
    }
</style>
<!--头部轮播图-->
<div id="index_touch" class="index_touch">
<ul id="touchCell" class="touchCell">
    <?php
	$slide = isset($slide['1'])?$slide['1']:[];
	foreach($slide as $k=>$val):
	?>
	<a href='<?=$val['url']?>'><li><img src='<?=$val['pic']?>'></li></a>
    <?php endforeach;?>
</ul>
<ul id="touchSort" class="index_touchSort"></ul>
</div>
<!--搜索框-->
<div class="index_search">
<input type="text" id="keyword" placeholder="请输入关键词" class="s_bar">
<a href="javascript:;" onclick="searchGoods()"><i class="icon-search"></i></a>
</div>
<!--导航菜单-->
<div class="index_nav">
    <ul class="wrap">
        <?php foreach($cat as $k1 => $v1):?>
            <?php if($v1['parent_id']==0 && $k1 < 8):?>
                <a href='/goods/lists?cat_id=<?=$v1["id"]?>'>
                	<li>
                	  <img src='<?=$v1['pic']?>'>
                	  <p><?=$v1['cat_title']?></p>
                	</li>
                </a>
            <?php endif;?>
        <?php endforeach;?>
    </ul>
</div>
<!---广告--->
<div class="advem_block"></div>
<!---广告--->
<?php foreach($cat as $k1 => $v1):?>
    <?php
    $goods = isset($v1['goods'])?$v1['goods']:[];
    ?>
    <!---楼层开始--->
    <div class="floor_container">
        <div class='floor_child'>
        	<div class='floor_head'>
        		<h1><?=$v1['cat_title']?></h1>
        		<span class='trasn_font'></span>
        		<a href='/goods/lists?cat_id=<?=$v1["id"]?>' class='fr'>查看更多<i class='icon-angle-right'></i></a>
        	</div>
        	<div class='floor_body'>
            	<div class='floor_item cF'>
                    <?php foreach($goods as $k=>$v):?>
                       <div class='contianer_c fl'>
                			<a href='/goods/detail?id=<?=$v['id']?>'>
                				<img src='<?=$v['pic']?>'>
                				<div class='shop_title'>
                					<p><?=$v['title']?></p>
                					<div>
                						<h6>￥<?=$v['price']?></h6>
                						<img src='/static/m/img/cart.png'/>
                					</div>
                				</div>
                			</a>
                		</div>
                    <?php endforeach;?>
            		<!--<ul class='twoUl'></ul>-->
            	</div>
            </div>
    		<!--<ul class='twoUl'></ul>-->
    	</div>
    </div>
<?php endforeach;?>
<!---楼层开始--->
<script>
TouchSlide({slideCell:"#index_touch",titCell:"#touchSort",mainCell:"#touchCell",effect:"leftLoop",autoPage:true,autoPlay:true});
$(function(){
//设置各级楼层主题色
var floorThemeColor=[
	'#F4C600',
	'#EB4F38',
	'#9D55B8',
	'#0061B2',
	'#56ABE4',
	'#00BB9C',
	'#7CBA59',
	'#DD6572'
];
var floorTrasnFont=[
	'Food and beverage',
	'Bedding home textiles',
	'Beauty care',
	'Digital accessories',
	'Living appliances',
	'Dress shoes',
	'Daily life'
];
var getFloor=$('.floor_container').children('.floor_child');
var getFloorHead=getFloor.children('.floor_head');
getColor=[],getFont=[];
for(var i=0;i<getFloor.length;i++){
	getColor=floorThemeColor[i];
	getFont=floorTrasnFont[i];
	getFloorHead=getFloor.eq(i).children('.floor_head');
	getFloorHead.css({"border-color":getColor})
	&&
	getFloorHead.find('h1').css({"color":getColor})
	&&
	getFloorHead.find('a').css({"color":getColor})
	&&
	getFloorHead.find('i').css({"color":getColor})
	&&
	getFloorHead.find('.trasn_font').text(getFont);
}
});
function searchGoods(){
var keywords =document.getElementById('keyword').value;
if(keywords == ""){
	layer.msg("请输入搜索关键词");
}else{
	window.location.href = '/goods/lists?keyword='+keywords;
}
}
</script>
